#version 330 core

layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aBoneIndex;
layout (location = 2) in vec2 aWeights;

uniform mat4 bones[2];

void main()
{
    int b_i_1 = int(aBoneIndex.x);
    int b_i_2 = int(aBoneIndex.y);

    float b_w_1 = aWeights.x;
    float b_w_2 = aWeights.y;

    gl_Position = bones[b_i_1] * vec4(aPos, 1.0) * b_w_1 + bones[b_i_2] * vec4(aPos, 1.0) * b_w_2;
}